<template>
  <div class="delete-confirm-overlay" v-if="visible">
    <div class="delete-confirm-dialog">
      <div class="dialog-content">
        <div class="dialog-header">
          <div class="dialog-icon">
            <img src="../assets/icons/删除.svg" alt="删除" />
          </div>
          <p class="dialog-message">此操作将永久删除该文件，是否继续？</p>
        </div>
        <div class="dialog-buttons">
          <button class="cancel-btn" @click="cancel">取消</button>
          <button class="confirm-btn" @click="confirm">确认</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DeleteConfirmDialog',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  emits: ['cancel', 'confirm'],
  setup(props, { emit }) {
    const cancel = () => {
      emit('cancel');
    };

    const confirm = () => {
      emit('confirm');
    };

    return {
      cancel,
      confirm
    };
  }
};
</script>

<style scoped>
.delete-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.delete-confirm-dialog {
  background-color: white;
  border-radius: 15px;
  padding: 25px;
  width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dialog-content {
  width: 100%;
}

.dialog-header {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

.dialog-icon {
  margin-right: 20px;
  display: flex;
  align-items: center;
}

.dialog-icon img {
  width: 30px;
  height: 30px;
}

.dialog-message {
  color: #515151;
  font-size: 16px;
  margin: 0;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
}

.cancel-btn, .confirm-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 15px;
}

.cancel-btn {
  background-color: #9A9A9A;
  color: white;
}

.confirm-btn {
  background-color: #6C85A4;
  color: white;
}
</style> 